<h2>Sửa thông tin sản phẩm</h2>
<script type="text/javascript">
	function Huy()
	{
		location.href = "./index.php?act=1";	
	}
</script>
<?php
	if(!isset($_GET["id"]))
	{
		header("location:./index.php?act=1");	
	}
	
	$id = $_GET["id"];
	$sql = "SELECT * FROM nguoidung WHERE manguoidung = ".$id;
	$result = DataProvider::ExecuteQuery($sql);
	$row = mysql_fetch_array($result);
?>
		<div class="form">
         <form action="./pages/taikhoan/xlSua.php" method="post">
         		<input type="hidden" name="manguoidung" value="<?php echo $row["manguoidung"]; ?>" />
                <fieldset>
                    <dl>
                        <dt><label for="email">Tên đăng nhập:</label></dt>
                        <dd><input type="text" name="tendangnhap" id="" size="54" value="<?php echo $row["tendangnhap"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Tên người dùng:</label></dt>
                        <dd><input type="text" name="tenguoidung" id="" size="54" value="<?php echo $row["tenguoidung"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="gender">Loại người dùng:</label></dt>
                        <dd>
                            <select size="1" name="loainguoidung" id="">
                            	<?php
									$sql = "SELECT * FROM loainguoidung";
									$result = DataProvider::ExecuteQuery($sql);
									while($dong = mysql_fetch_array($result))
									{
										if($dong["maloainguoidung"] == $row["maloainguoidung"])
										{
										?>
                                        	<option value="<?php echo $dong["maloainguoidung"]; ?>" selected><?php echo $dong["tenloainguoidung"];?></option>
                                        <?php		
										}
										else
										{
										?>
                                        	<option value="<?php echo $dong["maloainguoidung"]; ?>"><?php echo $dong["tenloainguoidung"];?></option>
                                        <?php
										}
									}
								?>
                            </select>
                        </dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Điện thoại:</label></dt>
                        <dd><input type="text" name="dienthoai" id="" size="54" value="<?php echo $row["dienthoai"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Email:</label></dt>
                        <dd><input type="text" name="email" id="" size="54" value="<?php echo $row["email"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Địa chỉ:</label></dt>
                        <dd><input type="text" name="diachi" id="" size="54" value="<?php echo $row["diachi"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Ngày sinh:</label></dt>
                        <dd><input type="text" name="ngaysinh" id="" size="54" value="<?php echo $row["ngaysinh"]; ?>" /></dd>
                    </dl>
                    <dl>
                        <dt><label for="email">Tình trạng:</label></dt>
                        <dd>
                        	<select name="bixoa">
                            	<?php
									if($row["BiXoa"] == 1)
									{
										?>
                                        	<option value="1" selected>Bị xóa</option>
                                        	<option value="0" >Kích hoạt</option>
                                        <?php	
									}
									else
									{
										?>
                                        	<option value="1">Bị xóa</option>
                                        	<option value="0" selected>Kích hoạt</option>
                                        <?php	
									}
								?>
                            </select>
                        </dd>
                    </dl>
                     <dl class="submit">
                    	<input type="submit" name="submit" id="submit" value="Cập nhật" />
                        <input type="button"  value="Hủy thao tác" onClick="Huy();" />
                     </dl>
                     
                </fieldset>
                
         </form>
         </div>